package com.tz.entity;

import javax.persistence.*;

/**
 * 地址实体类
 */
@Entity
@Table(name = "SHOP_ADDRESS")
public class Address extends BaseEntity {

    private static final long serialVersionUID = -5223209910446550299L;

    private String firstname;
    private String lastname;
    private String company;
    private String addressLine1;
    private String addressLine2;
    private String city;
    private String postcode;
    private String additionalInformation;
    private String homePhone;
    private String mobilePhone;
    private User user;

    public Address() {
    }

    public Address(String firstname, String lastname, String company,
                   String addressLine1, String addressLine2, String city, String postcode,
                   String additionalInformation, String homePhone, String mobilePhone,
                   User user) {
        super();
        this.firstname = firstname;
        this.lastname = lastname;
        this.company = company;
        this.addressLine1 = addressLine1;
        this.addressLine2 = addressLine2;
        this.city = city;
        this.postcode = postcode;
        this.additionalInformation = additionalInformation;
        this.homePhone = homePhone;
        this.mobilePhone = mobilePhone;
        this.user = user;
    }

    @Column
    public String getFirstname() {
        return firstname;
    }

    public void setFirstname(String firstname) {
        this.firstname = firstname;
    }

    @Column
    public String getLastname() {
        return lastname;
    }

    public void setLastname(String lastname) {
        this.lastname = lastname;
    }

    @Column
    public String getCompany() {
        return company;
    }

    public void setCompany(String company) {
        this.company = company;
    }


    @Column
    public String getAddressLine1() {
        return addressLine1;
    }

    public void setAddressLine1(String addressLine1) {
        this.addressLine1 = addressLine1;
    }

    @Column
    public String getAddressLine2() {
        return addressLine2;
    }

    public void setAddressLine2(String addressLine2) {
        this.addressLine2 = addressLine2;
    }

    @Column
    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city;
    }


    @Column
    public String getPostcode() {
        return postcode;
    }

    public void setPostcode(String postcode) {
        this.postcode = postcode;
    }

    @Column
    public String getAdditionalInformation() {
        return additionalInformation;
    }

    public void setAdditionalInformation(String additionalInformation) {
        this.additionalInformation = additionalInformation;
    }

    @Column
    public String getHomePhone() {
        return homePhone;
    }

    public void setHomePhone(String homePhone) {
        this.homePhone = homePhone;
    }

    @Column
    public String getMobilePhone() {
        return mobilePhone;
    }

    public void setMobilePhone(String mobilePhone) {
        this.mobilePhone = mobilePhone;
    }

    @ManyToOne
    @JoinColumn(name = "USER_ID", nullable = false)
    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    @Override
    public String toString() {
        return "Address [firstname=" + firstname + ", lastname=" + lastname
                + ", company=" + company + ", address=" + addressLine1
                + ", addressLine2=" + addressLine2 + ", city=" + city
                + ", code=" + postcode + ", additionalInformation="
                + additionalInformation + ", homePhone=" + homePhone
                + ", mobilePhone=" + mobilePhone + ", user=" + user + "]";
    }

}
